package org.dyyx.nrest.rest.mapping;

import java.lang.reflect.Method;

import org.dyyx.nrest.annotation.DeleteMapping;


public final class DeleteMappingRegisterStrategy extends AbstractRequestMappingRegisterStrategy implements RequestMappingRegisterStrategy {
    
    @Override
    public String getMethodUrl(Method method) {
        if(method.getAnnotation(DeleteMapping.class) != null) {
            return method.getAnnotation(DeleteMapping.class).value();
        }
        return "";
    }

  
    @Override
    public String getHttpMethod() {
        return "DELETE";
    }
    
 
    @Override
    public void registerMapping(String url, ControllerMapping mapping) {
        ControllerMappingRegistry.getDeleteMappings().put(url, mapping);
    }

}
